<?php
set_time_limit(600);
ini_set('memory_limit', '64M');
if (!empty($_REQUEST)  ) {
    $_type = $_REQUEST['type'];
    $_out = $_REQUEST['out'];
   
}
if(!(isset($_REQUEST['out']) && $_REQUEST['out'] == 'file'))
{
	 header('Content-Type: text/xml');
}
if (isset($argv)) {
    $_type = $argv[0];
}

require_once('conn.php');
require_once('settings.php');
require_once('inc/lib.function.php');

set_include_path(implode(':', array(
        realpath(dirname(__FILE__).DIRECTORY_SEPARATOR.'inc'),
        get_include_path()
    )
));

require_once('Xml/Factory.php');
echo Xml_Factory::factory($_type, $_out)->output();
